package org.example.booksystem.moudel;


public enum BookStatusEnum {
     DEFAULT(0,"无效")   ,
     NORMAL(1, "可借阅") ,
     FORBIDDEN(2 , "禁止借阅");


    private Integer code ;
    private String name ;

    public static BookStatusEnum getNameByCode(Integer code){
        switch(code){
            case 0: return DEFAULT ;
            case 1:return NORMAL ;
            case 2: return FORBIDDEN ;
        }
       return  null ;
    }

    BookStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }
    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
